#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include<string.h>
//int main() {
//    char arr1[128] = { 0 };
//    scanf("%s", arr1);
//    int numssize = strlen(arr1);
//    int i = 0; int j = 0; int count = 0;
//    for (i = 0; i <= 127; i++)
//    {
//        for (j = 0; j < numssize; j++)
//        {
//            if (i == arr1[j])
//            {
//                count++;
//                i++;
//            }
//        }
//    }
//    printf("%d", count);
//}
int* selfDividingNumbers(int left, int right, int* returnSize) {
    int* arr1 = (int*)malloc(sizeof(int) * (right - left + 1));
    *returnSize = 0;
    for (; left < right; left++)
    {
        int x = 10;
        int left_cp = left;
        while (left_cp)
        {
            if (left % (left_cp % x) != 0)
            {
                break;
            }
            left_cp /= 10;
        }
        if (left_cp == 0)
        {
            arr1[*returnSize] = left;
            (*returnSize)++;
        }
    }
    return arr1;
}
int main()
{
    int returnsize = 0;
    int*a=selfDividingNumbers(1,10,&returnsize);
    for (int i = 0; i < returnsize; i++)
    {
        printf("%d ", a[i]);
    }
}